<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			html,body{height:100%;}
		</style>
	</head>
	<body>
		<script type="text/javascript">
			var body 	 = document.body;
			var red 	 = 'red';		// 红色
			var blue 	 = 'blue';		// 蓝色
			var green 	 = 'green'; 	// 绿色
			var count 	 = 0;			// 当前点击的次数
			/*
			body.onclick = function(){
				count++;
				console.log(count);
				if(count == 1){
					body.style.backgroundColor = red;
				}
				if(count == 2){
					body.style.backgroundColor = blue;
				}
				if(count == 3){
					body.style.backgroundColor = green;
				}
			}
			*/
			var colorArray = ['red','blue','green'];
			body.onclick = function(){
				body.style.backgroundColor = colorArray[count];
				++count;
			}
		</script>
	</body>
</html>